<template>
  <div>
    <b>欢迎来到三方登录页面</b>
    <br><br><br>
    <img src="../assets/static/images/钉钉.png">
    &nbsp;&nbsp;&nbsp;
    <img src="../assets/static/images/码云.png">
    <br><br>
    <a-button type="primary" @click="DingLogin">钉钉登录</a-button>
    &emsp;&emsp;&emsp;
    <a-button type="dashed" @click="GiteeLogin">码云登录</a-button>
  </div>

</template>

<script>
export default {
  name: "ThreePartiesLogin",
  data(){
    return{

    }
  },
  methods:{
    DingLogin(){
      //拼接钉钉url
      let url = "https://oapi.dingtalk.com/connect/qrconnect?appid=dingoar91fvryq6pugb1nx&response_type=code&scope=snsapi_login&state=STATE&redirect_uri=http://127.0.0.1:8000/z/ding_back/"
      //进行站外跳转
      window.location.href = url;
    },
    GiteeLogin(){
      //创建应用后生成的Cliend ID
      var clientId = '7f611851ce2cbd381390632e50e10ab00108a207dcc00d6c8de686a40fd7cd15'
      //应用回调地址
      var redirect_uri = 'http://127.0.0.1:8000/z/git_back/'
      //拼接要请求的地址
      var url = 'https://gitee.com/oauth/authorize?client_id='+clientId+'&redirect_uri='+redirect_uri+'&response_type=code'
      // 进行跳转
      window.location.href = url;
    }
  }
}
</script>

<style scoped>
div{
  margin: 0 auto;
}
</style>
